import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 查询大工序列表
export function listGprocess(query) {
  return request({
    url: '/sl/gprocess/list',
    method: 'get',
    params: query
  })
}

// 查询大工序详细
export function getGprocess(gprocessId) {
  return request({
    url: '/sl/gprocess/' + parseStrEmpty(gprocessId),
    method: 'get'
  })
}

// 根据车间ID查询大工序列表
export function getGprocessListByWorkshopId(workshopId) {
  return request({
    url: '/sl/gprocess/glist/' + workshopId,
    method: 'get'
  })
}

// 新增大工序
export function addGprocess(data) {
  return request({
    url: '/sl/gprocess',
    method: 'post',
    data: data
  })
}

// 修改大工序
export function updateGprocess(data) {
  return request({
    url: '/sl/gprocess',
    method: 'put',
    data: data
  })
}

// 删除大工序
export function delGprocess(gprocessId) {
  return request({
    url: '/sl/gprocess/' + gprocessId,
    method: 'delete'
  })
}
